package com.iraeta.service.hik.impl;

import com.iraeta.dao.main.hik.WeiXinUserMapper;
import com.iraeta.entity.main.WeiXinUser;
import com.iraeta.service.hik.IWeiXinUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 微信用户Service业务层处理
 * 
 * @author 陈宾
 * @date 2023-10-06
 */
@Service
public class WeiXinUserServiceImpl implements IWeiXinUserService
{
    @Autowired
    private WeiXinUserMapper weiXinUserMapper;

    /**
     * 查询微信用户
     * 
     * @param id 微信用户主键
     * @return 微信用户
     */
    @Override
    public WeiXinUser selectWeiXinUserById(Long id)
    {
        return weiXinUserMapper.selectWeiXinUserById(id);
    }

    /**
     * 查询微信用户列表
     * 
     * @param weiXinUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<WeiXinUser> selectWeiXinUserList(WeiXinUser weiXinUser)
    {
        return weiXinUserMapper.selectWeiXinUserList(weiXinUser);
    }

    /**
     * 新增微信用户
     * 
     * @param weiXinUser 微信用户
     * @return 结果
     */
    @Override
    public int insertWeiXinUser(WeiXinUser weiXinUser)
    {
        weiXinUser.setCreateTime(new Date());
        return weiXinUserMapper.insertWeiXinUser(weiXinUser);
    }

    /**
     * 修改微信用户
     * 
     * @param weiXinUser 微信用户
     * @return 结果
     */
    @Override
    public int updateWeiXinUser(WeiXinUser weiXinUser)
    {
        weiXinUser.setUpdateTime(new Date());
        return weiXinUserMapper.updateWeiXinUser(weiXinUser);
    }

    /**
     * 批量删除微信用户
     * 
     * @param ids 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWeiXinUserByIds(Long[] ids)
    {
        return weiXinUserMapper.deleteWeiXinUserByIds(ids);
    }

    /**
     * 删除微信用户信息
     * 
     * @param id 微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWeiXinUserById(Long id)
    {
        return weiXinUserMapper.deleteWeiXinUserById(id);
    }
}
